/**
 * 
 */
package com.xbang.core.service.impl;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xbang.core.service.SendMailService;
import com.xbang.core.utils.SendMailUtils;

/**
 * @author dev.zhang
 * 
 */
@Service("sendMailService")
public class SendMailServiceImpl implements SendMailService {

	@Autowired
	private SendMailUtils sendMailUtils;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.xbang.core.service.MailService#sendMail(java.lang.String, java.lang.String, java.lang.String)
	 */
	public void send(String to, String toNickname, String subject, String messageText) throws Exception {
		sendMailUtils.send(to,toNickname,subject,messageText);

	}

	@Override
	public void send(String to, String toNickname, String subject,
			String messageText, List<File> files,String ... carbonCopys) throws Exception {
		sendMailUtils.send(to,toNickname,subject,messageText,files,carbonCopys);
	}
	public static void main(String[] args) {
		SendMailUtils sendMailUtils = new SendMailUtils();
		List<File> files = new ArrayList<File>();
		files.add(new File("E:\\test.xls"));
		try {
			sendMailUtils.send("120huawei@163.com","system","吐槽","吐槽",files);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
